
	const baseUrl="http://demonuxtapi.dishait.cn/mobile"
	const http= (options)=>{
		uni.showLoading({
				title: "加载中",
			    mask: true,
			});
		return new Promise((resolve,reject)=>{
	uni.request({
			url:baseUrl+options.url,
			method:options.method || "GET",
			data:options.data || {},
			timeout:5000,
			header:{
				"appid":"bd9d01ecc75dbbaaefce",
				"token":uni.getStorageSync("token")
			},
			success:(res)=>{
				resolve(res.data)
			},
			file:(err)=>{
				uni.showToast({
					duration:1500,
					title:'请求接口失败',
					mask:false
				})
				reject(err)
			},
			complete:()=>{
				uni.hideLoading()
			}
		})
	})
}

export default http